namespace VAdvantage.Model
{

/** Generated Model - DO NOT CHANGE */
using System;
using System.Text;
using VAdvantage.DataBase;
using VAdvantage.Common;
using VAdvantage.Classes;
using VAdvantage.Process;
using VAdvantage.Model;
using VAdvantage.Utility;
using System.Data;
/** Generated Model for M_Storage
 *  @author Jagmohan Bhatt (generated) 
 *  @version Vienna Framework 1.1.1 - $Id$ */
public class X_M_Storage : PO
{
public X_M_Storage (Context ctx, int M_Storage_ID, String trxName) : base (ctx, M_Storage_ID, trxName)
{
/** if (M_Storage_ID == 0)
{
SetM_AttributeSetInstance_ID (0);
SetM_Locator_ID (0);
SetM_Product_ID (0);
SetQtyOnHand (0.0);
SetQtyOrdered (0.0);
SetQtyReserved (0.0);
}
 */
}
public X_M_Storage (Ctx ctx, int M_Storage_ID, String trxName) : base (ctx, M_Storage_ID, trxName)
{
/** if (M_Storage_ID == 0)
{
SetM_AttributeSetInstance_ID (0);
SetM_Locator_ID (0);
SetM_Product_ID (0);
SetQtyOnHand (0.0);
SetQtyOrdered (0.0);
SetQtyReserved (0.0);
}
 */
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_Storage (Context ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_Storage (Ctx ctx, DataRow rs, String trxName) : base(ctx, rs, trxName)
{
}
/** Load Constructor 
@param ctx context
@param rs result set 
@param trxName transaction
*/
public X_M_Storage (Ctx ctx, IDataReader dr, String trxName) : base(ctx, dr, trxName)
{
}
/** Serial Version No */
static long serialVersionUID = 27542468366322L;
/** Last Updated Timestamp 12/9/2009 12:47:29 PM */
public static long updatedMS = 1260343049533L;
/** AD_Table_ID=250 */
public static int Table_ID=250;

/** TableName=M_Storage */
public static String Table_Name="M_Storage";

protected static KeyNamePair model = new KeyNamePair(250,"M_Storage");

protected Decimal accessLevel = new Decimal(3);
/** AccessLevel
@return 3 - Client - Org 
*/
protected override int Get_AccessLevel()
{
return Convert.ToInt32(accessLevel.ToString());
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Context ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Load Meta Data
@param ctx context
@return PO Info
*/
protected override POInfo InitPO (Ctx ctx)
{
POInfo poi = POInfo.GetPOInfo (ctx, Table_ID);
return poi;
}
/** Info
@return info
*/
public override String ToString()
{
StringBuilder sb = new StringBuilder ("X_M_Storage[").Append(Get_ID()).Append("]");
return sb.ToString();
}
/** Set Date last inventory count.
@param DateLastInventory Date of Last Inventory Count */
public void SetDateLastInventory (DateTime? DateLastInventory)
{
Set_Value ("DateLastInventory", (DateTime?)DateLastInventory);
}
/** Get Date last inventory count.
@return Date of Last Inventory Count */
public DateTime? GetDateLastInventory() 
{
return (DateTime?)Get_Value("DateLastInventory");
}
/** Set Attribute Set Instance.
@param M_AttributeSetInstance_ID Product Attribute Set Instance */
public void SetM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID)
{
if (M_AttributeSetInstance_ID < 0) throw new ArgumentException ("M_AttributeSetInstance_ID is mandatory.");
Set_ValueNoCheck ("M_AttributeSetInstance_ID", M_AttributeSetInstance_ID);
}
/** Get Attribute Set Instance.
@return Product Attribute Set Instance */
public int GetM_AttributeSetInstance_ID() 
{
Object ii = Get_Value("M_AttributeSetInstance_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Locator.
@param M_Locator_ID Warehouse Locator */
public void SetM_Locator_ID (int M_Locator_ID)
{
if (M_Locator_ID < 1) throw new ArgumentException ("M_Locator_ID is mandatory.");
Set_ValueNoCheck ("M_Locator_ID", M_Locator_ID);
}
/** Get Locator.
@return Warehouse Locator */
public int GetM_Locator_ID() 
{
Object ii = Get_Value("M_Locator_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Set Product.
@param M_Product_ID Product, Service, Item */
public void SetM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1) throw new ArgumentException ("M_Product_ID is mandatory.");
Set_ValueNoCheck ("M_Product_ID", M_Product_ID);
}
/** Get Product.
@return Product, Service, Item */
public int GetM_Product_ID() 
{
Object ii = Get_Value("M_Product_ID");
if (ii == null) return 0;
return Convert.ToInt32(ii);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair */
public KeyNamePair GetKeyNamePair() 
{
return new KeyNamePair(Get_ID(), GetM_Product_ID().ToString());
}
/** Set On Hand Quantity.
@param QtyOnHand On Hand Quantity */
public void SetQtyOnHand (Decimal? QtyOnHand)
{
if (QtyOnHand == null) throw new ArgumentException ("QtyOnHand is mandatory.");
Set_ValueNoCheck ("QtyOnHand", (Decimal?)QtyOnHand);
}
/** Get On Hand Quantity.
@return On Hand Quantity */
public Decimal GetQtyOnHand() 
{
Object bd =Get_Value("QtyOnHand");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
/** Set Ordered Quantity.
@param QtyOrdered Ordered Quantity */
public void SetQtyOrdered (Decimal? QtyOrdered)
{
if (QtyOrdered == null) throw new ArgumentException ("QtyOrdered is mandatory.");
Set_ValueNoCheck ("QtyOrdered", (Decimal?)QtyOrdered);
}
/** Get Ordered Quantity.
@return Ordered Quantity */
public Decimal GetQtyOrdered() 
{
Object bd =Get_Value("QtyOrdered");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}
/** Set Quantity Reserved.
@param QtyReserved Quantity Reserved */
public void SetQtyReserved (Decimal? QtyReserved)
{
if (QtyReserved == null) throw new ArgumentException ("QtyReserved is mandatory.");
Set_ValueNoCheck ("QtyReserved", (Decimal?)QtyReserved);
}
/** Get Quantity Reserved.
@return Quantity Reserved */
public Decimal GetQtyReserved() 
{
Object bd =Get_Value("QtyReserved");
if (bd == null) return Envs.ZERO;
return  Convert.ToDecimal(bd);
}

/** Get Quantity.
   @return Quantity */
public Decimal GetQty()
{
    Object bd = Get_Value("Qty");
    if (bd == null) return Envs.ZERO;
    return Convert.ToDecimal(bd);
}
/** Get Quantity Type.
    @return Quantity Type */
public String GetQtyType()
{
    return (String)Get_Value("QtyType");
}
}

}
